#ifndef WIDGETLOGTEXT_H
#define WIDGETLOGTEXT_H

#include <QTextEdit>
#include <QTextCharFormat>

class WidgetLogText : public QTextEdit
{
    Q_OBJECT
public:
    explicit WidgetLogText(QWidget *parent = nullptr);

public slots:
    void showMessage(const QString& header, const QString& content);

private slots:
    void on_customContextMenuRequested(const QPoint &pos);

private:
    QTextCharFormat _fmtDebug;
    QTextCharFormat _fmtInfo;
    QTextCharFormat _fmtWarn;
    QTextCharFormat _fmtError;

    QMenu* _contextMenu;
    QAction* _actionSelect;
    QAction* _actionCopy;
    QAction* _actionClear;
};

#endif // WIDGETLOGTEXT_H
